const robot = require("robotjs");
// console.log(robot)

const robotMouseDown = (data) => {
    // const double = data.double || false
    const { type, pageX, pageY,videoWidth, videoHeight, screenWidth, screenHeight } = data
    robot.moveMouse(pageX / videoWidth * screenWidth, pageY / videoHeight * screenHeight)
    setTimeout(() => {
        robot.mouseClick(type)
    }, 300);
}

const robotKeyTap = (key, modified = []) => {
    robot.keyTap(key, modified)
}

module.exports = {
    robotMouseDown,
    robotKeyTap
}